<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title><%=SETTING.website_name%></title>
  <%- include(VIEWROOT+'common/cssjs.html'); %>
</head>

<body class="hold-transition sidebar-mini">
  <div class="wrapper"> 

            <!-- Default box -->
            <div class="card card-primary">
                <div class="card-header">
                  <h3 class="card-title">会员列表</h3>
                </div>
                <div class="card-body p-0">
                  <form action="" method="get">
                    <input type="hidden" name="callback" value="<%=callback%>">
                    <table class="table table-bordered">
                      <tr>
                        <td>
                          <div class="input-group mb-3">
                            <div class="input-group-prepend">
                              <span class="input-group-text">ID</span>
                            </div>
                            <input type="text" name="userid" class="" placeholder="" value="<%=userid%>">
                            &nbsp;
                            <div class="input-group-prepend">
                              <span class="input-group-text">账号</span>
                            </div>
                            <input type="text" name="username" class="" placeholder="" value="<%=username%>">
                            &nbsp;
                            <div class="input-group-prepend">
                              <span class="input-group-text">所属组</span>
                            </div>
                            <select class="" name="groupid">
                                <option value="0">请选择</option>
                                <% for(var k in CORE_ENUMS.member_group){ %>
                                <option value="<%=k%>" <% if(groupid==k){ %>selected<% } %>><%=CORE_ENUMS.member_group[k]%></option>
                                <% } %>
                            </select>
                            &nbsp;
                            <div class="input-group-prepend">
                              <span class="input-group-text">真实姓名</span>
                            </div>
                            <input type="text" name="truename" class="" placeholder="" value="<%=truename%>">
                            &nbsp;
                            <button name="submit" type="submit" class="btn btn-primary">搜索</button>
                            &nbsp;
                            <button type="button" class="btn btn-warning" onclick="location.href='/member/outside?callback=<%=callback%>';">重置</button>
                          </div>
      
                        </td>
                      </tr>
                    </table>
                    </form>
                  
                  <table class="table table-bordered">
                    <% if(data){ %>
                    <thead>
                      <tr>
                        <th>ID</th>
                        <th>账号</th>
                        <th>所属组</th>
                        <th>真实姓名</th>
                      </tr>
                    </thead>
                    <tbody>
                      <% data.forEach(function(v,k){ %>
                      <% delete v.password; %>
                      <tr>
                          <td><%=v.userid%></td>
                          <td><a href='javascript:my_click(<%=JSON.stringify(v)%>);'><%=v.username%></a></td>
                          <td><%=functions.myswitch(v.groupid,CORE_ENUMS.member_group)%></td>
                          <td><%=v.truename%></td>
                      </tr>
                      <% }) %>
                      <tr>
                        <td colspan="100">
                          <%-pager%>
                        </td>
                      </tr>
                      <% }else{ %>
                      <tr>
                        <td colspan="100">暂无数据</td>
                      </tr>
                      <% } %>
                    </tbody>
                  </table>
                </div>
                <!-- /.card-body -->
              </div>
              <!-- /.card -->



  </div>
<script>
function my_click(arr){
  parent.<%=callback%>(arr);	
}
</script>
</body>

</html>